package com.zyg.apart.config;

import com.zyg.apart.filter.ApartFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ApartConfig {

    @Autowired
    private ApartFilter apartFilter;

    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(apartFilter);
        bean.addUrlPatterns("/*");
        return bean;
    }
}
